package com.scheduler.backend.po;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor

@Entity
@Table(name = "item_process")
@IdClass(ItemProcess.ItemProcessPK.class)
public class ItemProcess {

    @Id
    //@Column(name = "product_id")
    private String productId;

    @Column(name = "artifact_name")
    private String artifactName;

    @Column(name = "item_id")
    private String itemId;

    @Column(name = "item_type")
    private String itemType;

    @Column(name = "item_num")
    private Double itemNum;

    @Column(name = "unit")
    private String unit;

    @Id
    //@Column(name = "resource_name")
    private String resourceName;

    @Column(name = "resource_type")
    private String resourceType;

    @Column(name = "resource_kind")
    private String resourceKind;

    @Column(name = "production")
    private String production;

    @Column(name = "resource_priority")
    private Integer resourcePriority;

    @Column(name = "change_line_time")
    private Double changeLineTime;

    @Column(name = "people_needed")
    private Integer peopleNeeded;

    @Column(name = "deleted")
    private Integer deleted = 0;

    @lombok.Data
    @lombok.Builder
    @lombok.AllArgsConstructor
    @lombok.NoArgsConstructor
    public static class ItemProcessPK implements Serializable {

        private static final long serialVersionUID = 20201112;

        @Column(name = "product_id")
        private String productId;

        @Column(name = "resource_name")
        private String resourceName;

    }
}
